package com.jjc.android.adapter

import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.jjc.android.R
import com.jjc.android.UserManager
import com.jjc.android.activity.VideoPlayerActivity
import com.jjc.android.entity.DeviceDto
import com.jjc.android.util.Common
import com.jjc.android.util.showImage

class DeviceDetailAdapter : BaseQuickAdapter<DeviceDto,BaseViewHolder>(R.layout.item_device_detail) {


    override fun convert(helper: BaseViewHolder, item: DeviceDto) {
        helper.addOnClickListener(R.id.unBindBtn)
        val isMyAccount = item.ope0wk2ysioftswt?.find { it.id == UserManager.userId() }!=null
        helper.setText(R.id.newsTitleText,String.format("%s（%s%s）",if(isMyAccount) item.xoroodxlsn4riasa else Common.settingphone(item.xoroodxlsn4riasa),Common.parseFormat(item.createdAt,Common.sdf,Common.yymmdd),mContext.getString(R.string.bind_txt)))
        helper.setGone(R.id.unBindBtn,isMyAccount)
    }

}